package homework;

/**
 * @author wly
 * @create 2022-12-10 22:48
 */
public class Homework04 {
    public static void main(String[] args) {
        new CellPhone().testWork(new Calculator() {
            @Override
            public double work(double d1, double d2) {
                return d1 * d2;
            }
        }, 3.14, 2.68);
    }
}

interface Calculator{
    double work(double d1, double d2);
}

class CellPhone{

    public void testWork(Calculator calculator, double d1, double d2){
        double dd = calculator.work(d1, d2);
        System.out.println("result = " + dd);
    }
}